<template>
  <div class="product">
    <h3>标题：{{ msg.proname }}</h3>
    <p>价格:{{ msg.proprice }}元一根</p>
    <p>描述:{{ msg.desc }} <button @click="Haggle">点击砍一刀</button></p>
  </div>
</template>

<script>
export default {
  props: ['msg'],

  methods:{
    Haggle(){
      this.$emit('Haggle',this.msg.id,10)
    }
  }
}
</script>

<style lang="less" scoped>
.product {
  width: 400px;
  border: 3px solid #000;
  border-radius: 5px;
  margin: 10px;
  padding: 0 20px;
  &:hover {
    background-color: #087;
    color: #fff;
  }
}
</style>
